/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: nu uc
 * License Type: Evaluation
 */
package org.testis.orm.classes;

import org.orm.*;

public class T_bed_directserialconfig {
    public T_bed_directserialconfig() {
    }

    public boolean save() throws PersistentException {
	try {
	    org.testis.orm.manager.TestisDbPersistentManager.instance()
		    .saveObject(this);
	    return true;
	} catch (Exception e) {
	    e.printStackTrace();
	    throw new PersistentException(e);
	}
    }

    public boolean delete() throws PersistentException {
	try {
	    org.testis.orm.manager.TestisDbPersistentManager.instance()
		    .deleteObject(this);
	    return true;
	} catch (Exception e) {
	    e.printStackTrace();
	    throw new PersistentException(e);
	}
    }

    public boolean refresh() throws PersistentException {
	try {
	    org.testis.orm.manager.TestisDbPersistentManager.instance()
		    .getSession().refresh(this);
	    return true;
	} catch (Exception e) {
	    e.printStackTrace();
	    throw new PersistentException(e);
	}
    }

    public boolean evict() throws PersistentException {
	try {
	    org.testis.orm.manager.TestisDbPersistentManager.instance()
		    .getSession().evict(this);
	    return true;
	} catch (Exception e) {
	    e.printStackTrace();
	    throw new PersistentException(e);
	}
    }

    private int id;

    private String configName;

    private int port;

    private String boundary;

    private int dataBit;

    private int parity;

    private int stopBit;

    private int flowControl;

    private void setId(int value) {
	this.id = value;
    }

    public int getId() {
	return id;
    }

    public int getORMID() {
	return getId();
    }

    public void setConfigName(String value) {
	this.configName = value;
    }

    public String getConfigName() {
	return configName;
    }

    public void setPort(int value) {
	this.port = value;
    }

    public int getPort() {
	return port;
    }

    public void setBoundary(String value) {
	this.boundary = value;
    }

    public String getBoundary() {
	return boundary;
    }

    public void setDataBit(int value) {
	this.dataBit = value;
    }

    public int getDataBit() {
	return dataBit;
    }

    public void setParity(int value) {
	this.parity = value;
    }

    public int getParity() {
	return parity;
    }

    public void setStopBit(int value) {
	this.stopBit = value;
    }

    public int getStopBit() {
	return stopBit;
    }

    public void setFlowControl(int value) {
	this.flowControl = value;
    }

    public int getFlowControl() {
	return flowControl;
    }

    public String toString() {
	return toString(false);
    }

    public String toString(boolean idOnly) {
	if (idOnly) {
	    return String.valueOf(getId());
	} else {
	    StringBuffer sb = new StringBuffer();
	    sb.append("T_bed_directserialconfig[ ");
	    sb.append("Id=").append(getId()).append(" ");
	    sb.append("ConfigName=").append(getConfigName()).append(" ");
	    sb.append("Port=").append(getPort()).append(" ");
	    sb.append("Boundary=").append(getBoundary()).append(" ");
	    sb.append("DataBit=").append(getDataBit()).append(" ");
	    sb.append("Parity=").append(getParity()).append(" ");
	    sb.append("StopBit=").append(getStopBit()).append(" ");
	    sb.append("FlowControl=").append(getFlowControl()).append(" ");
	    sb.append("]");
	    return sb.toString();
	}
    }

}
